package com.luchao.springbootquartz.task;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
@EnableScheduling
public class SpringTask {
    /**
     * 每3秒执行一次
     */
    @Scheduled(cron = "0/3 * * * * ?")
    public void test(){
        System.out.println(new Date());
    }
}